{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. 使用 python 编程求解$$\\lim\\limits_{x\\rightarrow\\infty}\\frac{sinx}{x}$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n"
     ]
    }
   ],
   "source": [
    "import sympy\n",
    "from sympy  import oo\n",
    "import numpy as np\n",
    "\n",
    "x = sympy.Symbol(\"x\")\n",
    "f = sympy.sin(x)/x\n",
    "s = sympy.limit(f,x,oo)\n",
    "print(s)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. 使用 python 编程求解$$\\lim\\limits_{x\\rightarrow1}\\frac{x^2-1}{x-1}$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n"
     ]
    }
   ],
   "source": [
    "import sympy\n",
    "import numpy as np\n",
    "\n",
    "x = sympy.Symbol(\"x\")\n",
    "f = (x**2 - 1) / (x - 1)\n",
    "s = sympy.limit(f, x, 1)\n",
    "print(s)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
